import request from '@/config/axios'

// 商品标签 VO
export interface LabelVO {
  id: number // 主键id
  name: string // 标签名
}

// 商品标签 API
export const LabelApi = {
  // 查询商品标签分页
  getLabelPage: async (params: any) => {
    return await request.get({ url: `/product/label/page`, params })
  },

  // 查询商品标签详情
  getLabel: async (id: number) => {
    return await request.get({ url: `/product/label/get?id=` + id })
  },

  // 新增商品标签
  createLabel: async (data: LabelVO) => {
    return await request.post({ url: `/product/label/create`, data })
  },

  // 修改商品标签
  updateLabel: async (data: LabelVO) => {
    return await request.put({ url: `/product/label/update`, data })
  },

  // 删除商品标签
  deleteLabel: async (id: number) => {
    return await request.delete({ url: `/product/label/delete?id=` + id })
  },

  // 导出商品标签 Excel
  exportLabel: async (params) => {
    return await request.download({ url: `/product/label/export-excel`, params })
  },
}